package cn.scau.server.controller;

import cn.scau.server.service.AdminService;
import cn.scau.server.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 代码不跑我先跑
 * @since 2025-03-30
 */
@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    public AdminService adminService;

    // 根据管理员id查找管理员姓名
    @GetMapping("/getAdminNameById")
    public ResultVO getAdminNameById(Integer id) {
        return adminService.getAdminNameById(id);
    }

    //根据管理员account查找管理员id
    @GetMapping("/getAdminIdByAccount")
    public ResultVO getAdminIdByAccount(String account) {
        System.out.println(account);
        return adminService.getAdminIdByAccount(account);
    }

}
